package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

/**
 * @Auther: zh
 * @Date: 2025/5/31 - 05 - 31 - 19:40
 * @Description: com.sky.mapper
 * @version: 2.1
 */
@Mapper
public interface UserMapper {
    //插入数据
    void insert(User user);

    @Select("select *from user where openid=#{openid}")
    User getByOpenid(String openid);

    /**
     * 根据用户id查询用户信息
     * @param userId
     * @return
     */
    @Select("select *from user where id = #{userId}")
    User getById(Long userId);

    /**
     * 根据动态条件统计用户数量
     * @param map
     * @return
     */
    Integer countByMap(Map map);


}
